package DesignPattern.Structure.Decorator;

// 具体的装饰者角色
public class Bacon extends Garnish {

    public Bacon(FastFood food) {
        super(food, 2F, "培根");
    }

    @Override
    public float cost() {
        // 计算总价格
        return getPrice() + getFood().cost();
    }

    @Override
    public String getDesc() {
        return super.getDesc() + getFood().getDesc();
    }
}
